* Analysis: Part II
use "LIS_replication_data", clear

** Figure 3
twoway (scatter tr_5 year, mfcolor(gs8%25) mlcolor(gs8%0))  ///
 (lpoly tr_5 year if country=="Australia",  lpattern(solid) fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly tr_5 year if country=="Austria",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Belgium",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Canada",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Denmark",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Finland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Germany",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Greece",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Iceland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Ireland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Luxembourg",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Netherlands",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Norway",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Spain",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Sweden",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="Switzerland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="United Kingdom",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5 year if country=="United States",  fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly tr_5 year, lwidth(medthick) fcolor(gs0%100) lcolor(gs0%100)) ///
, legend(off)  xtitle("Year") ytitle("Transfers to M (share of H's income)") title("") ymtick(-.1(.05).2) ylabel(-.1(.1).2, angle(horizontal))	


twoway (scatter insurance_tr_5 year, mfcolor(gs8%25) mlcolor(gs8%0))  ///
 (lpoly insurance_tr_5 year if country=="Australia",  lpattern(solid) fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly insurance_tr_5 year if country=="Austria",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Belgium",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Canada",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Denmark",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Finland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Germany",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Greece",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Iceland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Ireland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Luxembourg",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Netherlands",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Norway",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Spain",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Sweden",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="Switzerland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="United Kingdom",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5 year if country=="United States",  fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly insurance_tr_5 year, lwidth(medthick) fcolor(gs0%100) lcolor(gs0%100)) ///
, legend(off)  xtitle("Year") ytitle("Transfers to M plus insurance (share of H's income)") title("") ymtick(-.1(.05).2) ylabel(-.1(.1).2, angle(horizontal))


twoway (scatter tr_5_of5 year, mfcolor(gs8%25) mlcolor(gs8%0))  ///
 (lpoly tr_5_of5 year if country=="Australia",  lpattern(solid) fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly tr_5_of5 year if country=="Austria",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Belgium",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Canada",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Denmark",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Finland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Germany",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Greece",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Iceland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Ireland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Luxembourg",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Netherlands",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Norway",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Spain",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Sweden",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="Switzerland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="United Kingdom",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly tr_5_of5 year if country=="United States",  fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly tr_5_of5 year, lwidth(medthick) fcolor(gs0%100) lcolor(gs0%100)) ///
, legend(off)  xtitle("Year") ytitle("Transfers to M (share of M's income)") title("") ymtick(-.2(.1).45) ylabel(-.2(.2)0.45, angle(horizontal))	


twoway (scatter insurance_tr_5_of5 year, mfcolor(gs8%25) mlcolor(gs8%0))  ///
 (lpoly insurance_tr_5_of5 year if country=="Australia",  lpattern(solid) fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly insurance_tr_5_of5 year if country=="Austria",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Belgium",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Canada",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Denmark",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Finland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Germany",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Greece",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Iceland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Ireland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Luxembourg",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Netherlands",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Norway",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Spain",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Sweden",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="Switzerland",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="United Kingdom",  fcolor(gs12%100) lcolor(gs12%100) ) ///
 (lpoly insurance_tr_5_of5 year if country=="United States",  fcolor(gs12%100) lcolor(gs12%100)) ///
 (lpoly insurance_tr_5_of5 year, lwidth(medthick) fcolor(gs0%100) lcolor(gs0%100)) ///
, legend(off)  xtitle("Year") ytitle("Transfers to M plus insurance (share of M's income)") title("") ymtick(-.2(.1).45) ylabel(-.2(.2)0.45, angle(horizontal))	


** Preparing data for analyses in Table 5
g tr_1pct=tr_1*100
g tr_5pct=tr_5*100
g insurance_tr_5pct=insurance_tr_5*100
g insurance50_tr_5pct=insurance50_tr_5*100

g ln_impute_openc=ln(impute_openc)

g trend=1+year-1974

xtset ccode year
** Table 5
xtreg tr_5pct p90p50 p50p10 ln_impute_openc impute_kaopen labfopar c.trend##c.trend, fe robust
xtreg tr_5pct p90p50 p50p10 ma_gov20 ln_impute_openc impute_kaopen labfopar c.trend##c.trend, fe robust
xtreg insurance_tr_5pct p90p50 p50p10 ln_impute_openc impute_kaopen labfopar  c.trend##c.trend, fe robust
xtreg insurance_tr_5pct p90p50 p50p10 ln_impute_openc impute_kaopen labfopar  ma_gov20 c.trend##c.trend, fe robust
 
 
* calculating effect sizes:
 xtreg tr_5pct p90p50 p50p10 ma_gov20 ln_impute_openc impute_kaopen labfopar c.trend##c.trend, fe robust
 estat sum
 * Effect size for partisanship
 di (1)*(3.677575*.379007)
 di 1.3938267/ 4.102827 
 
